package com.example.controller;

import com.example.respdto.resultDTO;
import com.example.service.uploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/")
public class testController {
    @Autowired
    uploadService uploadService;
    @RequestMapping("/upload")
    resultDTO upload(@RequestParam(value = "file") MultipartFile file) throws Exception{
      return   uploadService.upload(file);
    }

    @RequestMapping("test")
    public String test(){
        return "hellow test page!!";
    }
}
